#include <iostream>

#include "BITMAP.h"

int main(int argc,char** argv)
{
	RGBA *buffer;
	RGBA *newbuffer;
	
	CBitmap bitmap;
	if(bitmap.Load("C:\\A.bmp"))
	{
		buffer = (RGBA*)bitmap.GetBits();
		
		unsigned int width = bitmap.GetWidth();
		unsigned int height = bitmap.GetHeight();
		newbuffer = new RGBA[2*width*height];
		RGBA *newbufferptr = newbuffer;
		RGBA *bufferptr = buffer;

		for(unsigned int i = 0 ; i < height ; ++i)
		{
			for(unsigned int k = i*width, j = i*width*2 ,p = width*(2*i +1) ; k < width*( i + 1) ; ++k,++j,++p)
			{
				newbufferptr[j] = bufferptr[k];
				newbufferptr[p] = bufferptr[k];
			}
		}
		
		newbuffer = newbufferptr;
		buffer = bufferptr;
		
		bitmap.SetBits(newbufferptr,2*width,height);
		bitmap.Save("C:\\AA.bmp");

	}

	return 0;
}

